/**
****************************************************************************
*	@defgroup Test header for test application 
*	@author Li Suyong
*	@version 1.0
*	@date 2011/10/12
*****************************************************************************
@{ */

#pragma once

#include "common.h"

/** This is the TestApp namespace. */
namespace TestApp
{
	/** Define the test kinds. */
	typedef enum TestKind
	{
		CONSEQUENT_FUNCTION_CALLING, /**< Consequent function calling. */
		MAX_CASE /**< Max kinds num. */
	};

	/** Test application base class. */
	class TestApplication
	{
	public:
		/// do the work.
		void execute();

	protected:
		/** virtual function for test algorithm implementation.
		@note
			Every derived class should implement this function as thier own way.
		*/
		virtual void execute_impl() = 0;
	};

	/** Type for shared_ptr. */
	typedef std::tr1::shared_ptr<TestApplication> TestApplicationPtr;

	/** Test class : CONSEQUENT_FUNCTION_CALLING. */
	class TestApplication_ConsequentFunctionCalling : 
		public TestApplication
	{
	private:
		/// execute implementation.
		virtual void execute_impl();
	};

	/** The test application implementation factory. */
	class TestApplicationFactory :
		public CommonClasses::Singleton<TestApplicationFactory>
	{
	public:
		TestApplicationPtr getTestApp(TestKind testKind);
	};

}

/** @} */